﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
using Microsoft.Practices.Unity;
using Moq;

namespace NMortgage.UI.Tests
{
    public class UnityHelper
    {
        public IUnityContainer Container { get; private set; }

        public Mock<IWindowManager> WindowManager { get; private set; }
        public Mock<IEventAggregator> EventAggregator { get; private set; }


        public UnityHelper()
        {
            WindowManager = new Mock<IWindowManager>();
            EventAggregator = new Mock<IEventAggregator>();
            Container = new UnityContainer();
            Container.RegisterInstance(WindowManager.Object);
            Container.RegisterInstance(EventAggregator.Object);
        }

        public T Resolve<T>(params ResolverOverride[] parameterOverrides)
        {
            return Container.Resolve<T>(parameterOverrides);
        }
    }
}
